<div class="common_search_wrap">
	<select name="" id="">
		<option>Cate</option>
	</select>  
	<select name="type" id="type" onchange="changeCate()">
		<option value="">Question type</option>
		<?php foreach ($types as $k=>$v):?>
		<option value="<?php echo $v['id']?>"><?php echo $v['name']?></option>
		<?php endforeach;?>
	</select>
	Date:<input type="text" class="input2" value="Start" style="color:#ccc"> -
	<input type="text" class="input2" value="End" style="color:#ccc"> 
	<input type="text" class="input1" value="Keywords" style="color:#ccc">
	<input type="submit" class="search_submit2" value="Search" />
</div>
<div class="clear"></div>
		<table class="com_table" cellspacing="1" cellpadding="3">
			<tr>
            	<th style="width:22px; text-align: left;"><input type="checkbox"  onclick="checkAllBox(this);"/></th>
		<th>Cate</th>
		<th>Question type</th>
		<th>Question</th>
		<th>Date</th>
		<th>Manage</th>
	</tr>
	<?php 
	foreach ($ques['list'] as $k=>$v):?>
	<tr <?php if ($k%2==0){?>class="com_table_tr2"<?php }?>>
		<td ><input type="checkbox" class="checkitem" value="<?php echo $v['id'];?>"/></td>
		<td  style="text-align: center;"><?php if ($v['catename']){echo $v['catename'];}else{ echo '默认';}?></td>
		<td  style="text-align: center;"><?php echo $v['name'];?></td>
		<td><?php echo $v['question'];?></td>
		<td style="text-align: center;"><?php echo $v['utime'];?></td>
		<td style="text-align: center;">
		<a class='edit' href="<?php echo MVC_WWW_HOST.'library/add/id/'.$v['id'].'.html'?>">Edit</a>
		<a class='delete' href="javascript:;" onclick="delQues('<?php echo $v['id'];?>');">Del</a>
		</td>
	</tr>
            <?php endforeach;?>
	<tr class="com_table_tr4">
		<td><input type="checkbox"  onclick="checkAllBox(this);" /></td>
		<td><?php if (Http::get('do')=='setquiz'){
 							echo '<input type="button" value="Set" class="search_submit">';
                        }else{
                            echo '<input type="button" value="Delete" class="search_submit2" onclick="delQues()">';
                        }?>
		</td>
		<td colspan="4"style="text-align:right;padding-right:10px;position: relative;" class="page">
			<a style="left:0px;position: absolute;">Total:<?php echo $ques['total'];?> results</a>                         
			<?php echo $ques['html'];?>
		</td>
	</tr>
</table>
<script type="text/javascript">
$(".page a").click(function(){
	var url = $(this).attr('href');
    if(!url) return false;
	var sh=screen.height;	
	getHtml(url,'questions');
	return false;
})
function delQues(id){
	if(id){
		var items = id;
	}else{
		var items = getCheckItems();
	}
	if(items){
		var url = '<?php echo MVC_WWW_HOST.'library/del.html?id=';?>'+items;
		getUrl(url,1,1,'确认要删除吗？');
	}
}

</script>